package com.coderdream.chapter06.prototype.test;

import com.coderdream.chapter06.prototype.framework.Manager;
import com.coderdream.chapter06.prototype.framework.Product;
import com.coderdream.chapter06.prototype.real.MessageBox;
import com.coderdream.chapter06.prototype.real.UnderlinePen;

public class Main {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// 預備階段
		Manager manager = new Manager();
		UnderlinePen upen = new UnderlinePen('~');
		
		MessageBox mbox = new MessageBox('*');
		MessageBox sbox = new MessageBox('/');
		
		manager.register("strong message", upen);
		manager.register("warning box", mbox);
		manager.register("slash box", sbox);
	
		// 實現產生
		Product p1 = manager.create("strong message");
		p1.use("Hello, world.");
		Product p2 = manager.create("warning box");
		p2.use("Hello, world.");
		Product p3 = manager.create("slash box");
		p3.use("Hello, world.");
	}

}
